package com.cv.platform.controller.audit.comment;

import com.cv.framework.common.pojo.Result;
import com.cv.framework.role.core.annotations.RolePermit;
import com.cv.platform.service.comment.CvCommentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.cv.framework.common.pojo.Result.success;

/**
 * 客服审核平台 - 视频评论/回复评论控制层
 *
 * @author Charles_XDXD
 */
@Tag(name = "客服审核平台 - 视频评论/回复评论控制层")
@RestController
@RequestMapping("/platform/comment")
public class AuditCommentController {

    @Resource
    private CvCommentService cvCommentService;

    @GetMapping("getCommentContent")
    @Operation(summary = "获取评论内容")
    @RolePermit(values = "customer_service")
    public Result<String> getCommentContent(Long commentId) {
        return success(cvCommentService.getCommentContent(commentId));
    }

    @DeleteMapping("deleteComment")
    @Operation(summary = "删除评论")
    @RolePermit(values = "customer_service")
    public Result<Void> deleteComment(Long commentId) {
        cvCommentService.deleteComment(commentId);
        return success();
    }

}
